<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/system/mytable/Student.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/mytable/mytable/Student.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'stud_id',
                footer: "Foots",
                cnName: '学生基本信息',
                name: 'mytable/Student',
                url: "/Student/",
                sortName: "stud_id"
            });
            const editFormFields = ref({"no":"","name":"","age":"","lever_class":"","enterdatetime":"","add_all":"","z_fujian":""});
            const editFormOptions = ref([[{"title":"学生编号","field":"no","type":"text"},
                               {"title":"总分","field":"add_all","type":"text"},
                               {"title":"姓名","field":"name","type":"text"},
                               {"title":"年龄","required":true,"field":"age","type":"text"},
                               {"title":"班级","field":"lever_class","type":"text"},
                               {"title":"入学时间","field":"enterdatetime","type":"date"}],
                              [{"title":"总附件","field":"z_fujian","type":"file"}]]);
            const searchFormFields = ref({"no":"","name":"","age":"","lever_class":"","enterdatetime":"","add_all":"","z_fujian":""});
            const searchFormOptions = ref([[{"title":"学生编号","field":"no","type":"like"},{"title":"姓名","field":"name","type":"like"},{"title":"年龄","field":"age","type":"text"},{"title":"班级","field":"lever_class","type":"like"},{"title":"入学时间","field":"enterdatetime","type":"text"},{"title":"总分","field":"add_all","type":"text"}],[{"title":"总附件","field":"z_fujian"}]]);
            const columns = ref([{field:'stud_id',title:'stud_id',type:'int',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'no',title:'学生编号',type:'string ',link:true,width:110,align:'left',sort:true},
                       {field:'name',title:'姓名',type:'string ',width:110,align:'left'},
                       {field:'age',title:'年龄',type:'int',width:110,require:true,align:'left'},
                       {field:'lever_class',title:'班级',type:'string ',width:110,align:'left'},
                       {field:'enterdatetime',title:'入学时间',type:'datetime',width:110,align:'left',sort:true},
                       {field:'add_all',title:'总分',type:'int',width:80,align:'left'},
                       {field:'CreateID',title:'CreateID',type:'int',width:80,hidden:true,align:'left'},
                       {field:'Creator',title:'Creator',type:'string ',width:130,hidden:true,align:'left'},
                       {field:'CreateDate',title:'CreateDate',type:'datetime',width:150,hidden:true,align:'left',sort:true},
                       {field:'z_fujian',title:'总附件',type:'file',width:110,align:'left'}]);
            const detail = ref({
                cnName: "学生分数",
                table: "#detailTable",
                columns: [{field:'stud_grade_id',title:'stud_grade_id',type:'int',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'stud_id',title:'学生编号',type:'int',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'class_name',title:'课程名称',type:'string',width:110,edit:{type:'text'},require:true,align:'left',sort:true},
                       {field:'grade',title:'分数',type:'int',width:110,edit:{type:'text'},require:true,align:'left'},
                       {field:'fujian',title:'试卷附件',type:'string',width:110,edit:{type:'text'},align:'left'}],
                sortName: "stud_grade_id",
                key: "stud_grade_id"
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
